
// src/pages/CreateVM/Step1Basic.tsx
import React from 'react';
import { Form, Input, Select } from 'antd';
import { VMConfig } from './CreateVMWizard';

interface Step1Props {
  config: VMConfig;
  updateConfig: (updates: Partial<VMConfig>) => void;
}

const Step1Basic: React.FC<Step1Props> = ({ config, updateConfig }) => {
  return (
    <Form layout="vertical">
      <Form.Item label="虚拟机名称" required>
        <Input
          value={config.name}
          onChange={(e) => updateConfig({ name: e.target.value })}
          placeholder="例如: ubuntu-server-01"
        />
      </Form.Item>

      <Form.Item label="描述">
        <Input.TextArea
          value={config.description}
          onChange={(e) => updateConfig({ description: e.target.value })}
          placeholder="虚拟机用途描述（可选）"
          rows={3}
        />
      </Form.Item>

      <Form.Item label="操作系统类型" required>
        <Select
          value={config.osType}
          onChange={(value) => updateConfig({ osType: value })}
        >
          <Select.Option value="linux">Linux</Select.Option>
          <Select.Option value="windows">Windows</Select.Option>
          <Select.Option value="other">其他</Select.Option>
        </Select>
      </Form.Item>
    </Form>
  );
};

export default Step1Basic;